package com.org.gsc.zsqdemos.uis;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;

import com.ogaclejapan.smarttablayout.SmartTabLayout;
import com.org.gsc.zsqdemos.R;
import com.org.gsc.zsqdemos.adapters.MypstAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by qundui on 2017/6/18.
 */
public class SmartTabLayoutDemos extends FragmentActivity {
    private SmartTabLayout smartTabLayout;
    private ViewPager vp;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.smartdemo);
        vp= (ViewPager) findViewById(R.id.vp);
        smartTabLayout= (SmartTabLayout) findViewById(R.id.sm);


        List<String> mdatas=new ArrayList<>();
        for(int i=0;i<15;i++){
            mdatas.add("smart"+(i+1)+"tab");

        }
        vp.setAdapter(new MypstAdapter(getSupportFragmentManager(),mdatas));
        smartTabLayout.setViewPager(vp);
    }
}
